@echo off
setlocal enabledelayedexpansion

echo ================================================
echo System Architecture Analysis
echo ================================================
echo.

:: Check Windows version and architecture
ver
echo.

:: Check processor architecture
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x64" >nul
if %errorlevel% equ 0 (
    echo [OK] Processor: 64-bit (x64)
) else (
    reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" >nul
    if %errorlevel% equ 0 (
        echo [WARNING] Processor: 32-bit (x86)
    ) else (
        echo [UNKNOWN] Processor: Unknown architecture
    )
)

:: Check Windows architecture
wmic os get osarchitecture /value | find "64" >nul
if %errorlevel% equ 0 (
    echo [OK] Windows: 64-bit version
) else (
    wmic os get osarchitecture /value | find "32" >nul
    if %errorlevel% equ 0 (
        echo [WARNING] Windows: 32-bit version
    ) else (
        echo [UNKNOWN] Windows: Unknown architecture
    )
)

:: Check system type
systeminfo | find "System Type"

:: Check memory
wmic computersystem get totalphysicalmemory /value

:: Check if WSL2 is available
systeminfo | find "Hyper-V Requirements" >nul
if %errorlevel% equ 0 (
    echo [INFO] Hyper-V/WSL2: Available
) else (
    echo [WARNING] Hyper-V/WSL2: May not be available
)

:: Check for alternative solutions
echo.
echo ================================================
echo Compatibility Recommendations
echo ================================================
echo.

:: Check if Docker Toolbox is an option
where docker >nul 2>&1
if %errorlevel% neq 0 (
    echo [OPTION 1] Docker Toolbox for 32-bit systems:
    echo    - Use Docker Toolbox instead of Docker Desktop
    echo    - Requires VirtualBox
    echo    - Limited functionality but works on 32-bit
    echo.
)

:: Check if we can use alternative deployment
echo [OPTION 2] Manual deployment without Docker:
    echo    - Install Java 8+ directly
    echo    - Install MySQL directly
    echo    - Install Node.js directly
    echo    - Skip Docker entirely
    echo.

:: Check for cloud deployment
echo [OPTION 3] Cloud deployment:
    echo    - Use cloud services (AWS, Azure, etc.)
    echo    - No local system requirements
    echo    - Access via web browser
    echo.

:: Provide system info for debugging
echo ================================================
echo System Information for Support
echo ================================================
echo.
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" /C:"Total Physical Memory"
echo.

pause